package com.hfxt.util;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * md5加密
 */
public class SecurityUtil {
    //md5加密
    public static String md5Hex(String value) {
        return DigestUtils.md5Hex(value);
    }

    //3次md5加密
    public static String md5Hex3(String value) {
        for (int i = 0; i < 3; i++) {
            value = DigestUtils.md5Hex(value);
        }
        return value;
    }

    //sha256加密
    public static String sha256Hex(String value) {
        return DigestUtils.sha256Hex(value);
    }

    public static String sha512Hex(String value) {
        return DigestUtils.sha512Hex(value);
    }


}
